<?php

use think\migration\Migrator;
use think\migration\db\Column;

class BasicPollutantType extends Migrator
{
    public function change()
    {
        $table = $this->table('basic_pollutant_type');
        $table
            //step1:名称
            ->addColumn('name', 'string', ['limit' => 50, 'default' => '', 'comment' => '名称'])
            ->addColumn('is_source', 'integer', ['limit' => 2, 'default' => '0', 'comment' => '是否是污染物溯源，0不是1是'])
            ->addColumn('is_control', 'integer', ['limit' => 2, 'default' => '0', 'comment' => '是否是管控，0不是1是'])
            ->addColumn('description', 'string', ['limit' => 50, 'default' => '', 'comment' => '简介'])
            //注释
            ->setComment('基本信息 - 污染物类型')

            //引擎
            ->setEngine('InnoDB')
            ->save();
    }

}
